home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- # Expects one parameter which is the name of the file containing
- # the performance data.
-
- # On stdout it produces a table of the results - discarding the lowest and
- # highest, then averaging the remainder.
-
- # Leaves perf.4seg, perf.1seg
- # Creates graph.sr, graph.sw, graph.sc which are shell scripts
- # to display the graphs of read, write, create.
-
- # Each graph has an entry 0 0.0 forced in to give an origin. Could be removed.
-
- cat <<'EOF' >/usr/tmp/d.awk$$
- BEGIN { cnt = 0; max=0.0; min=1000.1; maxi=0.0; mini=1000.1;
- ndisks=0; rawefs="?"; async="?"; direct="?";
- nthrd=0; xfrsz=0; stepsz=0; xfrtyp="?";
- sr="?"; mbs=0.0; iops=0.0;
- }
- /^#TITLE/ { ttl1=$2; ttl2=$3; ttl3=$4; ttl4=$5; ttl5=$6;
- }
- / way stripe, step/ { ndisks=$1; stepsz=$6;
- cnt = 0; max=0.0; min=1000.1; maxi=0.0;
- mini=1000.1; rawefs="R"; async="?";
- direct=" "; nthrd=0; xfrsz=0;
- xfrtyp="?"; sr="?"; mbs=0.0; iops=0.0;
- if ( stepsz == 128 ) {
- printf "\n%s %s %s %s %s\n", ttl1, ttl2, ttl3, ttl4, ttl5;
- printf "step # # R/A/D # transfer # OS R/W seq MB/sec IOP/sec\n";
- printf "size busses LV E/M threads size disk rev C rand\n";
- }
- }
- /^$/ {prline();}
- /^mkfs/ {rawefs="E";}
- /^.usr.disk.sio -V -A/ {nthrd=$4; async="A";
- if ( $5 == "-D" ) {
- direct="D";
- }
- }
- /^sequential create/ {prline(); sr="S"; xfrtyp="C"; xfrsz=$4; }
- /^sequential write/ {prline(); sr="S"; xfrtyp="W"; xfrsz=$4; }
- /^sequential read/ {prline(); sr="S"; xfrtyp="R"; xfrsz=$4; }
- /blocks.*KB.*MB.*IO/ {mbs += $8; iops += $11; cnt++;
- if ( $8 > max ) {
- max = $8;
- }
- if ( $8 < min ) {
- min = $8;
- }
- if ( $11 > maxi ) {
- maxi = $11;
- }
- if ( $11 < mini ) {
- mini = $11;
- }
- }
-
- # {}
-
- function prline() {
- if ( cnt != 0 ) {
- printf "%4d %3d 1 %cM%c%c %4d %6d %3d 5.2 %c %3s %6.2f %5.2f\n", stepsz, ndisks/4, rawefs, async, direct, nthrd, xfrsz, ndisks, xfrtyp, sr, (mbs-max-min)/(cnt-2), (iops-maxi-mini)/(cnt-2);
- }
- cnt = 0; max=0.0; min=1000.1; maxi=0.0; mini=1000.1;
- mbs=0.0; iops=0.0;
- }
-
- END {
- prline();
- }
-
- EOF
- sed -e 's/[()]//g' -e 's/^------* /#TITLE /' -e 's/^\(#TITL.*\) -----*$/\1/' $1 | nawk -f /usr/tmp/d.awk$$ |tee /usr/tmp/d.res$$
- rm -f /usr/tmp/d.awk$$
- #Split into perf.4seg, perf.1seg
- sed -e '1,/^Dir.*4/d' -e '1,2d' -e '/^$/,$d' /usr/tmp/d.res$$|sort -n >perf.4seg
- sed -e '1,/^Dir.*1/d' -e '1,2d' -e '/^$/,$d' /usr/tmp/d.res$$|sort -n >perf.1seg
- #Start of graph ------------------------------------------------
- #Start of write graph ------------------------------------------------
- cat <<EOF >graph.sw
- #!/bin/sh
- exec xgraph -t "Write" -x "step size" -y "MBytes/sec" <<EOD
- "Direct 4 segment"
- 0 0.0
- EOF
- grep '^ .* W ' perf.4seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* W *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sw
- cat <<EOF >>graph.sw
-
- "Direct 1 segment"
- 0 0.0
- EOF
- grep '^ .* W ' perf.1seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* W *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sw
- cat <<EOF >>graph.sw
-
- EOD
- EOF
- chmod 755 graph.sw
- ./graph.sw&
- #End of Write graph ------------------------------------------------
- #Start of Read graph ------------------------------------------------
- cat <<EOF >graph.sr
- #!/bin/sh
- exec xgraph -t "Read" -x "step size" -y "MBytes/sec" <<EOD
- "Direct 4 segment"
- 0 0.0
- EOF
- grep '^ .* R ' perf.4seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* R *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sr
- cat <<EOF >>graph.sr
-
- "Direct 1 segment"
- 0 0.0
- EOF
- grep '^ .* R ' perf.1seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* R *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sr
- cat <<EOF >>graph.sr
-
- EOD
- EOF
- chmod 755 graph.sr
- ./graph.sr&
- #End of Read graph ------------------------------------------------
- #Start of Create graph ------------------------------------------------
- cat <<EOF >graph.sc
- #!/bin/sh
- exec xgraph -t "Create" -x "step size" -y "MBytes/sec" <<EOD
- "Direct 4 segment"
- 0 0.0
- EOF
- grep '^ .* C ' perf.4seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* C *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sc
- cat <<EOF >>graph.sc
-
- "Direct 1 segment"
- 0 0.0
- EOF
- grep '^ .* C ' perf.1seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* C *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sc
- cat <<EOF >>graph.sc
-
- EOD
- EOF
- chmod 755 graph.sc
- ./graph.sc&
- #End of Create graph ------------------------------------------------
-